Ext.define('SKJF.view.PENJUALAN.v_lunaspiutang_form', {
	extend	: 'Ext.form.Panel',
	
	alias	: 'widget.v_lunaspiutang_form',
	
	//region:'east',
	//id: 'east-region-container',
	
	title		: 'Create/Update lunaspiutang',
    bodyPadding	: 5,
    autoScroll	: true,
    
    initComponent: function(){
    	/*
		 * Deklarasi variable setiap field
		 */
		 
		var KODE_CUSTOMER_field = Ext.create('Ext.form.field.Text', {
			itemId: 'KODE_CUSTOMER_field',
			name: 'KODE_CUSTOMER', /* column name of table */
			fieldLabel: 'KODE_CUSTOMER',
			allowBlank: false /* jika primary_key */,
			maxLength: 7 /* length of column name */
		});
		var NAMA_CUSTOMER_field = Ext.create('Ext.form.field.Text', {
			name: 'NAMA_CUSTOMER', /* column name of table */
			fieldLabel: 'NAMA_CUSTOMER',
			maxLength: 30 /* length of column name */
		});
		var NOMOR_INVOICE_field = Ext.create('Ext.form.field.Text', {
			name: 'NOMOR_INVOICE', /* column name of table */
			fieldLabel: 'NOMOR_INVOICE',
			maxLength: 25 /* length of column name */
		});
		var TANGGAL_INVOICE_field = Ext.create('Ext.form.field.Date', {
			name: 'TANGGAL_INVOICE', /* column name of table */
			format: 'Y-m-d',
			fieldLabel: 'TANGGAL_INVOICE'
		});
		var CURRENCY_field = Ext.create('Ext.form.field.Text', {
			name: 'CURRENCY', /* column name of table */
			fieldLabel: 'CURRENCY',
			maxLength: 3 /* length of column name */
		});
		var JENIS_TRANSAKSI_field = Ext.create('Ext.form.field.Text', {
			name: 'JENIS_TRANSAKSI', /* column name of table */
			fieldLabel: 'JENIS_TRANSAKSI',
			maxLength: 1 /* length of column name */
		});
		var TOTAL_field = Ext.create('Ext.ux.form.NumericField', {
			name: 'TOTAL', /* column name of table */
			fieldLabel: 'TOTAL',
			useThousandSeparator: true,
			decimalPrecision: 2,
			alwaysDisplayDecimals: true,
			currencySymbol: 'Rp',
			thousandSeparator: '.',
			decimalSeparator: ','
		});
		var KURS_field = Ext.create('Ext.form.field.Number', {
			name: 'KURS', /* column name of table */
			fieldLabel: 'KURS',
			maxLength: 11 /* length of column name */
		});
		var SISA_field = Ext.create('Ext.ux.form.NumericField', {
			name: 'SISA', /* column name of table */
			fieldLabel: 'SISA',
			useThousandSeparator: true,
			decimalPrecision: 2,
			alwaysDisplayDecimals: true,
			currencySymbol: 'Rp',
			thousandSeparator: '.',
			decimalSeparator: ','
		});
		var KURS_BAYAR_field = Ext.create('Ext.form.field.Number', {
			name: 'KURS_BAYAR', /* column name of table */
			fieldLabel: 'KURS_BAYAR',
			maxLength: 11 /* length of column name */
		});
		var DIBAYAR_field = Ext.create('Ext.form.field.Number', {
			name: 'DIBAYAR', /* column name of table */
			fieldLabel: 'DIBAYAR',
			maxLength: 11 /* length of column name */
		});
		var NOMOR_GIRO_field = Ext.create('Ext.form.field.Text', {
			name: 'NOMOR_GIRO', /* column name of table */
			fieldLabel: 'NOMOR_GIRO',
			maxLength: 25 /* length of column name */
		});
		var TGL_JATUH_TEMPO_field = Ext.create('Ext.form.field.Date', {
			name: 'TGL_JATUH_TEMPO', /* column name of table */
			format: 'Y-m-d',
			fieldLabel: 'TGL_JATUH_TEMPO'
		});
		var NOMOR_BAYAR_field = Ext.create('Ext.form.field.Text', {
			name: 'NOMOR_BAYAR', /* column name of table */
			fieldLabel: 'NOMOR_BAYAR',
			maxLength: 25 /* length of column name */
		});
		var TGL_BAYAR_field = Ext.create('Ext.form.field.Date', {
			name: 'TGL_BAYAR', /* column name of table */
			format: 'Y-m-d',
			fieldLabel: 'TGL_BAYAR'
		});
		var APA_LUNAS_field = Ext.create('Ext.form.field.Text', {
			name: 'APA_LUNAS', /* column name of table */
			fieldLabel: 'APA_LUNAS',
			maxLength: 1 /* length of column name */
		});
		var MULAI_PERIODE_field = Ext.create('Ext.form.field.Date', {
			name: 'MULAI_PERIODE', /* column name of table */
			format: 'Y-m-d',
			fieldLabel: 'MULAI_PERIODE'
		});
		var AKHIR_PERIODE_field = Ext.create('Ext.form.field.Date', {
			name: 'AKHIR_PERIODE', /* column name of table */
			format: 'Y-m-d',
			fieldLabel: 'AKHIR_PERIODE'
		});		
        Ext.apply(this, {
            fieldDefaults: {
                labelAlign: 'right',
                labelWidth: 120,
                msgTarget: 'qtip',
				anchor: '100%'
            },
			defaultType: 'textfield',
            items: [KODE_CUSTOMER_field,NAMA_CUSTOMER_field,NOMOR_INVOICE_field,TANGGAL_INVOICE_field,CURRENCY_field,JENIS_TRANSAKSI_field,TOTAL_field,KURS_field,SISA_field,KURS_BAYAR_field,DIBAYAR_field,NOMOR_GIRO_field,TGL_JATUH_TEMPO_field,NOMOR_BAYAR_field,TGL_BAYAR_field,APA_LUNAS_field,MULAI_PERIODE_field,AKHIR_PERIODE_field],
			
	        buttons: [{
                iconCls: 'icon-save',
                itemId: 'save',
                text: 'Save',
                disabled: true,
                action: 'save'
            }, {
                iconCls: 'icon-add',
				itemId: 'create',
                text: 'Create',
                action: 'create'
            }, {
                iconCls: 'icon-reset',
                text: 'Cancel',
                action: 'cancel'
            }]
        });
        
        this.callParent();
    }
});